/*
 * =====================================================================================
 *
 *       Filename:  TestBinaryHeap.cpp
 *    Description:  
 *
 *        Created:  2009年10月27日 17时05分00秒
 *         Author:  Sanli (), santal.li@gmail.com
 *
 * =====================================================================================
 */
#include "../commons/BinaryHeap.h"

#include <iostream>

using namespace std ;

int main(){
    cout << "===============start test===============" << endl ;

    int i[] = { 3 , 6, 7 ,8, 100 , 124 , 34 , 78, 65, 12, 33, 34 , 80, 90} ;
    
    BinaryHeap<int> bh ;

    for( int *a = i ; a < i + (sizeof(i) / sizeof(int)) ; a ++ ){
        cout << *a << "->";
        bh.insert(*a);
    }
    cout << "\n----- do heap sort -----" << endl ;

    while( ! bh.isEmpty()){
        cout<< bh.findMin()<< "->";    
        bh.deleteMin();
    }
    cout << "\n----- heap sort finished -----" << endl ;


}
